;(function(FormBase) {
    FormBase.Checkcode = FormBase.extend({
        msgObj: { // error msg
            NUM_6: "请输入正确的验证码"
        },
        susFun: function() {},
        errFun: function() {},
        checkForm: function() {
            var regNum = /^\d{1,6}$/;
            var regNum1 = /\d{1,6}/;
            
            if (!regNum.test(this.newValue)) {
                return {
                    status: false,
                    msg: this.getMsg("NUM_6"),
                    value: regNum1.exec(this.newValue) || ''
                };
            }else{
                if (this.newValue.length == 6 || this.newValue.length == 4) {
                    return {
                        status: true,
                        msg: '',
                        value: this.newValue
                    };
                } else {
                    return {
                        status: false,
                        msg: this.getMsg("NUM_6"),
                        value: this.newValue
                    };
                }
            }
           
        }

    });
})(window.FormBase = window.FormBase || {})
